const fs = require('fs');
const data = 'abcdefg'
fs.writeFile('./write.txt', data, err => {
    if(err) return console.log(err);
    console.log(`数据${data}写入成功`);
})